<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<script src="../js/common/jquery.js"></script>
<script src="../js/common/drag.js"></script>
<script src="../js/common/angular.min.js"></script>
<script type="text/javascript" src="../js/common/common.js"></script>
<script type="text/javascript" src="../js/event.js"></script>
</head>
<body ng-app="myApp">

<div class="dqwz">
    <span>当前位置：</span>
    <span>AngularJS 事件</span>
</div>

<section>
    <div ng-controller="clickCtrl">
        <h3>【ng-click 指令】</h3>
        <button type="button" ng-click="add()">加一</button>
        <span>显示：{{number}}</span>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<button type="button" ng-click="add()">加一</button>
<span>显示：{{number}}</span>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('clickCtrl',function($scope){
    $scope.number = 0;
    $scope.add = function(){
        $scope.number = $scope.number+1;
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
    <div ng-controller="hideCtrl">
        <h3>【显示/隐藏 HTML 元素(ng-hide)】</h3>
        <button type="button" ng-click="toggle()">点击显示/隐藏</button>
        <p ng-hide="bool">我在这里</p>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<button type="button" ng-click="toggle()">点击显示/隐藏</button>
<p ng-hide="bool">我在这里</p>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('hideCtrl',function($scope){
    $scope.bool = false;
    $scope.toggle=function(){
        $scope.bool = !$scope.bool;
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
    <div ng-controller="showCtrl">
        <h3>【显示/隐藏 HTML 元素(ng-show)】</h3>
        <button type="button" ng-click="toggle()">点击显示/隐藏</button>
        <p ng-show="bool">我在这里</p>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<button type="button" ng-click="toggle()">点击显示/隐藏</button>
<p ng-show="bool">我在这里</p>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('showCtrl',function($scope){
    $scope.bool = true;
    $scope.toggle=function(){
        $scope.bool = !$scope.bool;
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
</section>

<div class="mask_layer">
</div>
</body>
</html>
